My file bash, and configurate for linux
sudo apt install gnupg
echo "aria fatah" > file
# enkripsi
gpg -c file # cipher simetris yang digunakan adalah AES256. Kita bisa memilih lainnya menggunakan opsi --cipher-algo bila mau.
ls # file file.gpg
rm file # agar tidak nabark ketika decrypt
# decrypt
gpg file.gpg
sudo apt install openssl
# create key / generate rsa
openssl genrsa -aes128 -out haris_private.pem 1024a
# Enter PEM pass phrase:
# Verifying - Enter PEM pass phrase:
# make the file mudah dibaca
openssl rsa -in haris_private.pem -noout -text
# extract private key to public key
openssl rsa -in haris_private.pem -pubout > haris_public.pem
# read the key to easyy
openssl rsa -in haris_public.pem -pubin -text -noout
# encrypt file
echo "aria fatah" > file.txt
openssl pkeyutl -encrypt -inkey haris_public.pem -pubin -in file.txt -out file_rahasia.enc
# decrypt file
openssl pkeyutl -decrypt -inkey haris_private.pem -in file_rahasia.enc > file_terbuka.txt